<?php

use Illuminate\Http\Request;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/

Route::middleware('auth:api')->get('/user', function (Request $request) {
    return $request->user();
});
//Route::post('login','');
Route::post('login', 'API\UserController@login');
Route::post('register', 'API\UserController@register');

Route::group(['middleware' => 'auth:api'], function(){
   // Route::post('details', 'UserController@details');
    Route::get('articles',['as'=>'articles.index','uses'=>'ArticleController@index']);
    Route::get('articles-categories',['as'=>'articles.cateList','uses'=>'ArticleController@cateList']);
    Route::get('tasks',['as'=>'articles.tasks','uses'=>'ArticleController@taskList']);
});